FROM python:3

LABEL authors="Jiazh"

# 配置工作目录
WORKDIR /app

# 复制当前目录下的所有文件到容器的/app目录
COPY . .

RUN sudo apt-get update &&\
    sudo apt install python3-pip -y

RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt

# 生成迁移文件
RUN python3 manage.py migrate

ENTRYPOINT ["python3", "manage.py", "runserver", "0.0.0.0:8000"]